home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 2 / Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso / Pearls / gfx / pbm / source / jpegV5.lha / jpegV5 / man / cjpeg.man < prev    next >
Text File  |  1994-09-29  |  12KB  |  331 lines

  1.  
  2.  
  3.  
  4.      CJPEG(1)             AMIGA (30 August 1994)              CJPEG(1)
  5.  
  6.  
  7.  
  8.      NAME
  9.           cjpeg - compress an image file to a JPEG file
  10.  
  11.      SYNOPSIS
  12.           cjpeg [ options ] [ filename ]
  13.  
  14.      DESCRIPTION
  15.           cjpeg compresses the named image file, or the standard input
  16.           if no file is named, and produces a JPEG/JFIF file on the
  17.           standard output.  The currently supported input file formats
  18.           are: PPM (PBMPLUS color format), PGM (PBMPLUS gray-scale
  19.           format), BMP, GIF, Targa, and RLE (Utah Raster Toolkit
  20.           format).  (RLE is supported only if the URT library is
  21.           available.)
  22.  
  23.      OPTIONS
  24.           All switch names may be abbreviated; for example, -grayscale
  25.           may be written -gray or -gr.  Most of the "basic" switches
  26.           can be abbreviated to as little as one letter.  Upper and
  27.           lower case are equivalent (thus -GIF is the same as -gif).
  28.           British spellings are also accepted (e.g., -greyscale),
  29.           though for brevity these are not mentioned below.
  30.  
  31.           The basic switches are:
  32.  
  33.           -quality N
  34.                Scale quantization tables to adjust image quality.
  35.                Quality is 0 (worst) to 100 (best); default is 75.
  36.                (See below for more info.)
  37.  
  38.           -grayscale
  39.                Create monochrome JPEG file from color input.  Be sure
  40.                to use this switch when compressing a grayscale GIF
  41.                file, because cjpeg isn't bright enough to notice
  42.                whether a GIF file uses only shades of gray.  By saying
  43.                -grayscale, you'll get a smaller JPEG file that takes
  44.                less time to process.
  45.  
  46.           -optimize
  47.                Perform optimization of entropy encoding parameters.
  48.                Without this, default encoding parameters are used.
  49.                -optimize usually makes the JPEG file a little smaller,
  50.                but cjpeg runs somewhat slower and needs much more
  51.                memory.  Image quality and speed of decompression are
  52.                unaffected by -optimize.
  53.  
  54.           -targa
  55.                Input file is Targa format.  Targa files that contain
  56.                an "identification" field will not be automatically
  57.                recognized by cjpeg; for such files you must specify
  58.                -targa to make cjpeg treat the input as Targa format.
  59.                For most Targa files, you won't need this switch.
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 9/28/94)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      CJPEG(1)             AMIGA (30 August 1994)              CJPEG(1)
  71.  
  72.  
  73.  
  74.           The -quality switch lets you trade off compressed file size
  75.           against quality of the reconstructed image: the higher the
  76.           quality setting, the larger the JPEG file, and the closer
  77.           the output image will be to the original input.  Normally
  78.           you want to use the lowest quality setting (smallest file)
  79.           that decompresses into something visually indistinguishable
  80.           from the original image.  For this purpose the quality
  81.           setting should be between 50 and 95; the default of 75 is
  82.           often about right.  If you see defects at -quality 75, then
  83.           go up 5 or 10 counts at a time until you are happy with the
  84.           output image.  (The optimal setting will vary from one image
  85.           to another.)
  86.  
  87.           -quality 100 will generate a quantization table of all 1's,
  88.           eliminating loss in the quantization step (but there is
  89.           still information loss in subsampling, as well as roundoff
  90.           error).  This setting is mainly of interest for experimental
  91.           purposes.  Quality values above about 95 are not recommended
  92.           for normal use; the compressed file size goes up
  93.           dramatically for hardly any gain in output image quality.
  94.  
  95.           In the other direction, quality values below 50 will produce
  96.           very small files of low image quality.  Settings around 5 to
  97.           10 might be useful in preparing an index of a large image
  98.           library, for example.  Try -quality 2 (or so) for some
  99.           amusing Cubist effects.  (Note: quality values below about
  100.           25 generate 2-byte quantization tables, which are considered
  101.           optional in the JPEG standard.  cjpeg emits a warning
  102.           message when you give such a quality value, because some
  103.           commercial JPEG programs may be unable to decode the
  104.           resulting file.  Use -baseline if you need to ensure
  105.           compatibility at low quality values.)
  106.  
  107.           Switches for advanced users:
  108.  
  109.           -dct int
  110.                Use integer DCT method (default).
  111.  
  112.           -dct fast
  113.                Use fast integer DCT (less accurate).
  114.  
  115.           -dct float
  116.                Use floating-point DCT method.  The floating-point
  117.                method is the most accurate, but will be the slowest
  118.                unless your machine has very fast floating-point
  119.                hardware.  Also note that results of the floating-point
  120.                method may vary slightly across machines, while the
  121.                integer methods should give the same results
  122.                everywhere.  The fast integer method is much less
  123.                accurate than the other two.
  124.  
  125.           -restart N
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 9/28/94)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      CJPEG(1)             AMIGA (30 August 1994)              CJPEG(1)
  137.  
  138.  
  139.  
  140.                Emit a JPEG restart marker every N MCU rows, or every N
  141.                MCU blocks if "B" is attached to the number.  -restart
  142.                0 (the default) means no restart markers.
  143.  
  144.           -smooth N
  145.                Smooth the input image to eliminate dithering noise.
  146.                N, ranging from 1 to 100, indicates the strength of
  147.                smoothing.  0 (the default) means no smoothing.
  148.  
  149.           -maxmemory N
  150.                Set limit for amount of memory to use in processing
  151.                large images.  Value is in thousands of bytes, or
  152.                millions of bytes if "M" is attached to the number.
  153.                For example, -max 4m selects 4000000 bytes.  If more
  154.                space is needed, temporary files will be used.
  155.  
  156.           -outfile name
  157.                Send output image to the named file, not to standard
  158.                output.
  159.  
  160.           -verbose
  161.                Enable debug printout.  More -v's give more output.
  162.                Also, version information is printed at startup.
  163.  
  164.           -debug
  165.                Same as -verbose.
  166.  
  167.           The -restart option inserts extra markers that allow a JPEG
  168.           decoder to resynchronize after a transmission error.
  169.           Without restart markers, any damage to a compressed file
  170.           will usually ruin the image from the point of the error to
  171.           the end of the image; with restart markers, the damage is
  172.           usually confined to the portion of the image up to the next
  173.           restart marker.  Of course, the restart markers occupy extra
  174.           space.  We recommend -restart 1 for images that will be
  175.           transmitted across unreliable networks such as Usenet.
  176.  
  177.           The -smooth option filters the input to eliminate fine-scale
  178.           noise.  This is often useful when converting GIF files to
  179.           JPEG: a moderate smoothing factor of 10 to 50 gets rid of
  180.           dithering patterns in the input file, resulting in a smaller
  181.           JPEG file and a better-looking image.  Too large a smoothing
  182.           factor will visibly blur the image, however.
  183.  
  184.           Switches for wizards:
  185.  
  186.           -arithmetic
  187.                Use arithmetic coding rather than Huffman coding.  (Not
  188.                currently supported for legal reasons.)
  189.  
  190.           -baseline
  191.                Force a baseline JPEG file to be generated.  This
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 9/28/94)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      CJPEG(1)             AMIGA (30 August 1994)              CJPEG(1)
  203.  
  204.  
  205.  
  206.                clamps quantization values to 8 bits even at low
  207.                quality settings.
  208.  
  209.           -nointerleave
  210.                Generate noninterleaved JPEG file (not yet supported).
  211.  
  212.           -qtables file
  213.                Use the quantization tables given in the specified
  214.                file.  The file should contain one to four tables (64
  215.                values each) as plain text.  Comments preceded by '#'
  216.                may be included in the file.  The tables are implicitly
  217.                numbered 0,1,etc.  If -quality N is also specified, the
  218.                values in the file are scaled according to cjpeg's
  219.                quality scaling curve.
  220.  
  221.           -qslots N[,...]
  222.                Select which quantization table to use for each color
  223.                component.  By default, table 0 is used for luminance
  224.                and table 1 for chrominance components.
  225.  
  226.           -sample HxV[,...]
  227.                Set JPEG sampling factors.  If you specify fewer H/V
  228.                pairs than there are components, the remaining
  229.                components are set to 1x1 sampling.  The default
  230.                setting is equivalent to -sample 2x2.
  231.  
  232.           The "wizard" switches are intended for experimentation with
  233.           JPEG.  If you don't know what you are doing, don't use them.
  234.           You can easily produce files with worse image quality and/or
  235.           poorer compression than you'll get from the default
  236.           settings.  Furthermore, these switches should not be used
  237.           when making files intended for general use, because not all
  238.           JPEG implementations will support unusual JPEG parameter
  239.           settings.
  240.  
  241.      EXAMPLES
  242.           This example compresses the PPM file foo.ppm with a quality
  243.           factor of 60 and saves the output as foo.jpg:
  244.  
  245.                cjpeg -quality 60 foo.ppm > foo.jpg
  246.  
  247.      HINTS
  248.           Color GIF files are not the ideal input for JPEG; JPEG is
  249.           really intended for compressing full-color (24-bit) images.
  250.           In particular, don't try to convert cartoons, line drawings,
  251.           and other images that have only a few distinct colors.  GIF
  252.           works great on these, JPEG does not.  If you want to convert
  253.           a GIF to JPEG, you should experiment with cjpeg's -quality
  254.           and -smooth options to get a satisfactory conversion.
  255.           -smooth 10 or so is often helpful.
  256.  
  257.           Avoid running an image through a series of JPEG
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 9/28/94)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      CJPEG(1)             AMIGA (30 August 1994)              CJPEG(1)
  269.  
  270.  
  271.  
  272.           compression/decompression cycles.  Image quality loss will
  273.           accumulate; after ten or so cycles the image may be
  274.           noticeably worse than it was after one cycle.  It's best to
  275.           use a lossless format while manipulating an image, then
  276.           convert to JPEG format when you are ready to file the image
  277.           away.
  278.  
  279.           The -optimize option to cjpeg is worth using when you are
  280.           making a "final" version for posting or archiving.  It's
  281.           also a win when you are using low quality settings to make
  282.           very small JPEG files; the percentage improvement is often a
  283.           lot more than it is on larger files.
  284.  
  285.      ENVIRONMENT
  286.           JPEGMEM
  287.                If this environment variable is set, its value is the
  288.                default memory limit.  The value is specified as
  289.                described for the -maxmemory switch.  JPEGMEM overrides
  290.                the default value specified when the program was
  291.                compiled, and itself is overridden by an explicit
  292.                -maxmemory.
  293.  
  294.      SEE ALSO
  295.           djpeg(1), rdjpgcom(1), wrjpgcom(1)
  296.           ppm(5), pgm(5)
  297.           Wallace, Gregory K.  "The JPEG Still Picture Compression
  298.           Standard", Communications of the ACM, April 1991 (vol. 34,
  299.           no. 4), pp. 30-44.
  300.  
  301.      AUTHOR
  302.           Independent JPEG Group
  303.  
  304.      BUGS
  305.           Arithmetic coding is not supported for legal reasons.
  306.  
  307.           Not all variants of BMP and Targa file formats are
  308.           supported.
  309.  
  310.           The -targa switch is not a bug, it's a feature.  (It would
  311.           be a bug if the Targa format designers had not been
  312.           clueless.)
  313.  
  314.           Still not as fast as we'd like.
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 9/28/94)
  328.  
  329.  
  330.  
  331.